<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	if (session.getAttribute("email") == null
			|| session.getAttribute("token") == null) {
		response.sendRedirect(basePath);
	} else {
		// Set to expire far in the past.
		response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

		// Set standard HTTP/1.1 no-cache headers.
		response.setHeader("Cache-Control",
				"no-store, no-cache, must-revalidate");

		// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
		response
				.addHeader("Cache-Control", "post-check=0, pre-check=0");

		// Set standard HTTP/1.0 no-cache header.
		response.setHeader("Pragma", "no-cache");
	}
%>

<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>EIA Project 1 Home Page</title>
		<link rel="stylesheet"
			href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
		<link rel="stylesheet" type="text/css" href="css/template.css" />
		<link rel="canonical"
			href="http://www.alessioatzeni.com/wp-content/tutorials/jquery/login-box-modal-dialog-window/index.html" />
		<link rel="stylesheet" href="/resources/demos/style.css" />
		<script type="text/javascript"
			src="http://code.jquery.com/jquery-1.9.1.js"></script>
		<script type="text/javascript"
			src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
		<script type="text/javascript" src="jquery/template.js"></script>

	</head>

	<body>
		<h1>
			<br>
			Welcome
			<%=session.getAttribute("email")%><small> This is implemented
				by Josh & Tony | <a href="http://www.unimelb.edu.au/"> Have a
					nice day! </a> </small>
		</h1>
		<div class="container">
			<div id="content">

				<div class="post">
					<h2>
						Welcome to this home page, you can do a lot of things here, for
						example:
					</h2>
					<div class="btn-sign">
						<a href="#Delete-box" class="delete-window"> Delete my
							registration</a>
					</div>
				</div>

				<div id="Delete-box" class="login-popup">
					<a href="#" class="close"><img src="close_pop.png"
							class="btn_close" title="Close Window" alt="Close" /> </a>
					<P>
						Are you sure you want to delete all your registration information?
					</P>
					<center>
						<button id="delete" class="submit button" name="servlet/Delete">
							Confirm
						</button>
						<p id="message-delete" class="message" style="color: red; display: none"></p>
				</div>




				<div class="post">
					<h2>
						Or click here to log out:
					</h2>
					<div class="btn-sign">
						<a href="#logout-box" class="logout-window"> Log out</a>
					</div>
				</div>

				<div id="logout-box" class="login-popup">
					<a href="#" class="close"><img src="close_pop.png"
							class="btn_close" title="Close Window" alt="Close" /> </a>

					<P>
						Confirm to log out?
					</P>
					<button id="logout" class="submit button" name="servlet/Logout">
						Confirm
					</button>
					<p id="message-logout" class="message" style="color: red; display: none"></p>
				</div>

				<div class="post">
					<h2>
						Or click here to reset your password:
					</h2>
					<div class="btn-sign">
						<a href="#reset-box" class="reset-window"> Reset</a>
					</div>
				</div>

				<div id="reset-box" class="login-popup">
					<a href="#" class="close"><img src="close_pop.png"
							class="btn_close" title="Close Window" alt="Close" /> </a>
					<P>
						Confirm to reset password?
					</P>
					<button id="reset" class="submit button" type="submit"
						name="servlet/Reset">
						Confirm
					</button>
					<p id="message-reset" class="message" style="color: red; display: none"></p>
				</div>
			</div>
		</div>
	</body>
</html>
